# -*- coding: utf-8 -*-
import pygame
pygame.init()
from sys import exit
from pygame.locals import *

def win_rules(screen,brick,level):
	won = False
	if len(brick) == 0:
		won = True
		congrats(screen,level)
	return won

def congrats(screen,level):
	font = pygame.font.SysFont("arial", 40)
	score_font = pygame.font.SysFont("arial", 35)
	font_little = pygame.font.SysFont("arial", 20)
	outline = Rect((100,150),(400,200))
	box = Rect((110,160),(380,180))
	pressed_keys = pygame.key.get_pressed()
	show_menu = True
	clock = pygame.time.Clock()
	while show_menu == True:
		event = pygame.event.poll()
		if event.type == QUIT:
			exit()
		take_input()

		time_passed = clock.tick(60)
		
		
		pygame.draw.rect(screen,(255,255,255),outline)
		pygame.draw.rect(screen,(0,0,0),box)
		if level == 1:
			screen.blit(font.render("Round 2!", True, (250, 250, 250)), (160, 170) )
			pygame.display.update()
			pygame.time.delay(3000)
			show_menu = False
		if level == 2:
			screen.blit(font.render("YOU WON!", True, (250, 250, 250)), (170, 170) )
			screen.blit(font_little.render("I... really didn't expect that...", True, (250, 250, 250)), (160, 310) )
			

		pygame.display.update()



def quit(pressed_keys):

	if pressed_keys[K_ESCAPE]:
		exit()


def take_input():
	pressed_keys = pygame.key.get_pressed()
	quit(pressed_keys)
	